Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part 1 of zero knowledge proofs; computing G(x) #978

Merged
merged 5 commits into from
Mar 17, 2024
Merged

Conversation

benjaminsavage
Copy link
Collaborator

@benjaminsavage benjaminsavage commented Mar 16, 2024

At each step of the process, the prover has two vectors, u and v. These are compressed by some compression factor λ (e.g. 4) to produce new vectors u and v with length λ times shorter.

At each step, the prover computes s polynomials p_i(x) and q_i(x), (where s = u.len() / λ). The polynomials p_i(x) are defined as the polynomials passing through particular coordinates of the vector u, and the polynomials q_i(x) are defined as the polynomials passing through particular coordinates of the vector v.

Now the prover generates a distributed zero knowledge proof. This proof is just a polynomial G(x) which is defined as the sum from i=0 to i=s of p_i(x) * q_i(x).

Rather than computing the coefficients of this polynomial G(x), the prover can just generate 2*λ - 1 points on this curve - as that uniquely defines the polynomial. We will always generate the y values of the points corresponding to the x-coordinates 0, 1, 2, ..., 2*λ - 2.

The first λ points can be found trivially by just multiplying the known values of p_i(x) and q_i(x). The next λ - 1 points require more computation. The prover can just use Lagrange interpolation to generate the next λ - 1 points on each polynomial p_i(x) and q_i(x), and then multiply these together and sum over i.

See a concrete example in this sheet: https://docs.google.com/spreadsheets/d/10tCSgiZyQbt4bMB3KqhAUOCfgfO8xIni83J2saipFCg/edit?usp=sharing
Tab: "All Lagrange Interpolation"

Copy link

codecov bot commented Mar 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.33%. Comparing base (3777d9f) to head (661259c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #978      +/-   ##
==========================================
+ Coverage   89.31%   89.33%   +0.02%     
==========================================
  Files         161      162       +1     
  Lines       21900    21946      +46     
==========================================
+ Hits        19560    19606      +46     
  Misses       2340     2340              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benjaminsavage benjaminsavage merged commit 661259c into main Mar 17, 2024
20 checks passed
@benjaminsavage benjaminsavage deleted the compute_g branch March 17, 2024 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant